<div class="form-ajax">
<form class="AjaxForm" data-action="{:U()}" method="post" >
    <table class="bordered color">
        <foreach name="_input" item="v">
        <if condition="$v['type'] == 'hidden'">
            <input type="hidden" name="{$v.name}" value="{$v.value}" {$v.attr}>
        <else/>
            <tr>
                <th>{$v.title}</th>
                <td>
                <switch name="v.type">
                    <case value="textarea">
                        <textarea name="{$v.name}" <notempty name="v.valid">datatype="{$v.valid}"</notempty> tip="{$v.tip}" {$v.attr} >{$v.value}</textarea>
                    </case>
                    <case value="select">
                        <select name="{$v.name}" <notempty name="v.valid">datatype="{$v.valid}"</notempty>  tip="{$v.tip}" {$v.attr}>
                        <foreach name="v.param" item="vv" key="kk">
                            <option value="{$kk}" <eq name="v.value" value="$kk">selected</eq> >{$vv}</option>
                        </foreach>
                        </select>
                    </case>
                    <case value="radio">
                        <foreach name="v.param" item="vv" key="kk">
                        <input type="radio" id="{$v.name}_{$kk}" name="{$v.name}" value="{$kk}" <eq name="v.value" value="$kk">checked</eq> {$v.attr}><label for="{$v.name}_{$kk}">{$vv}</label>
                        </foreach>
                    </case>
                    <case value="datetime">
                        {:W('Datetime/dateTime',array($v['name'],$v['value']))}
                    </case>
                    <case value="date">
                        {:W('Datetime/date',array($v['name'],$v['value']))}
                    </case>
                    <default />
                        <input type="text" name="{$v.name}" value="{$v.value}" <notempty name="v.valid">datatype="{$v.valid}"</notempty> tip="{$v.tip}" {$v.attr}>
                </switch>
                </td>
            </tr>
        </if>
        </foreach>
        <tr>
        	<th></th>
            <td><input type="submit" class="btn-big btn-blue" value="提交"></td>
        </tr>
    </table>
</form>
</div>

<script type="text/javascript">
    seajs.use(['ajax'],function(ajax){
        ajax.valid();
    });
</script>